const app = getApp()
import webSocket from '../../utils/socket'
import fetch from '../../utils/services'
Page({
  data: {
    message: '', //输入框的内容
    // 群组信息
    groupInfo: {
      status: 1, // 组状态 1：会议未开始  2： 会议中
      avator: 'http://pic4.zhimg.com/50/v2-0019ec92840b3cda9c12445d4452e4a5_hd.jpg', //群组头像
      name: '杨超越读书会', //群组名
      memberCount: 12, //群组成员数
      mettingCount: 2, //会议中的成员数
    },
    myInfo: {
      userId: 4
    },
    list: [
      {
        userId: 1,
        userName: '嬴渠梁',
        userAvator: 'http://pic4.zhimg.com/50/v2-0019ec92840b3cda9c12445d4452e4a5_hd.jpg',
        content: '我迁都咸阳, 再来商鞅变法, 尔等奈我何？'
      },
      {
        userId: 2,
        userName: '嬴驷',
        userAvator: 'http://pic4.zhimg.com/50/v2-0019ec92840b3cda9c12445d4452e4a5_hd.jpg',
        content: '父王, 我重用的张仪莫非比你的商鞅要差？况且我可是和齐楚联合称王的人，您敢么？'
      },
      {
        userId: 3,
        userName: '嬴荡',
        userAvator: 'http://pic4.zhimg.com/50/v2-0019ec92840b3cda9c12445d4452e4a5_hd.jpg',
        content: '我谁也不重用， 我重用自己，要不然怎么可能在周室太庙举鼎， 被鼎压死呢'
      },
      {
        userId: 4,
        userName: '嬴稷',
        userAvator: 'http://pic4.zhimg.com/50/v2-0019ec92840b3cda9c12445d4452e4a5_hd.jpg',
        content: '大哥,你的举鼎而亡， 成就了我的霸业啊。白起， 这个名字听起来问风丧胆么？就没打败过。我在位56年， 你们谁做得到'
      },
      {
        userId: 5,
        userName: '嬴子楚',
        userAvator: 'http://pic4.zhimg.com/50/v2-0019ec92840b3cda9c12445d4452e4a5_hd.jpg',
        content: '各位列祖列宗都别说了， 赢政你们认识吧， 统一全国你们知道吧！我生的，我生的，也是你们的后代'
      },
      {
        userId: 6,
        userName: '嬴政',
        userAvator: 'http://pic4.zhimg.com/50/v2-0019ec92840b3cda9c12445d4452e4a5_hd.jpg',
        content: '又想拿我说事， 我强我骄傲，'
      },
    ],
    toView: '', //滚动到的页面位置
    isWaiting: true, // 是否正在等待接听
    waitingType: '2', // 等待接听音视频的类型  1: 视频  2:音频,
    memberInfo: [ // 群内组员信息,
      {
        userName: '嬴渠梁',
        uid: 1,
        role: 'broadcaster',
        userId: 1,
        userAvator: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575039616765&di=12fb193b2ef10840529ebf8d42b35c9e&imgtype=0&src=http%3A%2F%2Fa2.att.hudong.com%2F77%2F05%2F01300543009208142148051756514_s.jpg'
      },
      {
        userName: '嬴驷',
        uid: 2,
        role: 'participator',
        userId: 2,
        userAvator: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575039825676&di=276bdadd2017e1658a1b73e6abcac8cb&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201803%2F04%2F20180304111707_bdpyf.png'
      },
      {
        userName: '嬴稷',
        uid: 3,
        role: 'participator',
        userId: 3,
        userAvator: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575039856457&di=54761495f5b84b73932175c7e34b6a7a&imgtype=0&src=http%3A%2F%2Fp.ssl.qhimg.com%2Ft01ffa7134372b9a5d0.jpg'
      },
      {
        userName: '嬴政',
        uid: 5,
        role: 'participator',
        userId: 5,
        userAvator: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575039895781&di=bf5073615942704672189b49d6525f07&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn15%2F591%2Fw334h257%2F20180927%2Fcd63-hiixpuq0795876.jpg'
      },
      {
        userName: '嬴子楚',
        uid: 4,
        role: 'participator',
        userId: 4,
        userAvator: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575039935104&di=a77522c8bc63bbc473767db189c3cf17&imgtype=0&src=http%3A%2F%2Fww2.sinaimg.cn%2Flarge%2F6a5984dejw1exoy1vvl6zj20dw0fsgny.jpg'
      }
    ]
  },
  onLoad: function (options) {
    this.setData({ toView: `msg_${this.data.list.length - 1}` })
  },
  onUnload: function() {
  },
})
